'use strict';

// 提交试题
exports.main = async (event, context) => {
	const db = uniCloud.database();
	const collection = db.collection('collection_subject');
	// 插入单条数据
	if (event.subject) { 
		let res = await collection.add(event.subject);
		return {
			code: '1',
			msg: 'success',
		};
	} 

	return {
		code: '0',
		msg: 'fail',
	};

};
